package com.zyp.test.test;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.LinearLayout;

/**
 * @author zyp
 *         2017/12/20
 */

public class MyViewGroupA extends LinearLayout {
    public MyViewGroupA(Context context) {
        super(context);
    }

    public MyViewGroupA(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.d("MyViewGroupA","dispatchTouchEvent:" +ev.getAction());
        /*switch (ev.getAction()){
            case MotionEvent.ACTION_DOWN:
                Log.d("MyViewGroupA","dispatchTouchEvent:" +"ACTION_DOWN");
                break;
            case MotionEvent.ACTION_MOVE:
                Log.d("MyViewGroupA","dispatchTouchEvent:" +"ACTION_MOVE");
                break;
            case MotionEvent.ACTION_UP:
                Log.d("MyViewGroupA","dispatchTouchEvent:" +"ACTION_UP");
                break;
        }*/
       
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        Log.d("MyViewGroupA","onInterceptTouchEvent:" +ev.getAction());
        /*switch (ev.getAction()){
            case MotionEvent.ACTION_DOWN:
                Log.d("MyViewGroupA","onInterceptTouchEvent:" +"ACTION_DOWN");
                break;
            case MotionEvent.ACTION_MOVE:
                Log.d("MyViewGroupA","onInterceptTouchEvent:" +"ACTION_MOVE");
                break;
            case MotionEvent.ACTION_UP:
                Log.d("MyViewGroupA","onInterceptTouchEvent:" +"ACTION_UP");
                break;
        }*/
        return super.onInterceptTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.d("MyViewGroupA","onTouchEvent:" +event.getAction());
        /*switch (event.getAction()){
            case MotionEvent.ACTION_DOWN:
                Log.d("MyViewGroupA","onTouchEvent:" +"ACTION_DOWN");
                break;
            case MotionEvent.ACTION_MOVE:
                Log.d("MyViewGroupA","onTouchEvent:" +"ACTION_MOVE");
                break;
            case MotionEvent.ACTION_UP:
                Log.d("MyViewGroupA","onTouchEvent:" +"ACTION_UP");
                break;
        }*/
        return super.onTouchEvent(event);
    }
}
